

#ifndef __OPT_SWINGUP_H__
#define __OPT_SWINGUP_H__


/*
    purpose: calculate kinetic energy

    input:
        double AngleSpeedAct    - actual angle speed of pendulum [rad/s] (a1_iso)

    return:
        double E_pot            - potential energy [J]

*/
double OptSwingUp_Ekin (double AngleSpeedAct);

/*
    purpose: calculate potential energy

    input:
        double AngleAct     - actual angle of pendelum [rad] (a0_iso)

    return:
        double E_pot        - potential energy [J]

*/
double OptSwingUp_Epot( double AngleAct);

/*
    purpose: calculate desired acceleration of cart

    input:
        double AngleSpeedAct     - actual angle speed of pendulum [rad/s] (a1_iso)
        double AngleAct          - actual angle of pendelum [rad] (a0_iso)
        double DiffCartDesPos    - difference to desired cart position [ XXX ]
        double CartSpeedAct      - actual speed of cart [m/s] (x1_iso)
        double EKinAct           - actual kinetic energy of pendelum [J]
        double EPotAct           - actual potential energy of pendelum [J]

    return:
        double OptSwingUp_AccDes - desired cart acceleration [m/s^2]

*/
double OptSwingUp_AccDes(   double AngleSpeedAct,
                            double AngleAct,
                            double DiffCartDesPos,
                            double CartSpeedAct,
                            double EKinAct,
                            double EPotAct
                        );




#endif /* __OPT_SWINGUP_H__ */


